<?php
//上传
$uploadMgr = new \Qiniu\Storage\UploadManager();
$auth = new \Qiniu\Auth(config('qiniu')['accessKey'],config('qiniu')['secretKey']);
$token = $auth->uploadToken(config('qiniu')['bucket']);
list($ret, $error) = $uploadMgr->putFile($token,'book_show/'.$li , env('root_path').'public/book_show/'.$li);
if($error){
	$this->error('附件上传静态云失败');
}

//删除
$key=Db::name('book_show')->where('id',$data['id'])->value('mp3');
$auth = new \Qiniu\Auth(config('qiniu')['accessKey'], config('qiniu')['secretKey']);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucketManager->delete(config('qiniu')['bucket'], substr($key,1));

//检查文件是否存在
$auth = new \Qiniu\Auth(config('qiniu')['accessKey'],config('qiniu')['secretKey']);
$key='需要检查文件';
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
list($fileInfo, $err) = $bucketManager->stat(config('qiniu')['bucket'], $key);
if ($err) {
	print_r($err);
} else {
	print_r($fileInfo);
}